package com.vlin.config.tuya;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import com.vlin.api.client.request.ParamsConfig;
import com.vlin.api.client.request.tuya.SimpleParamsConfig;
import com.vlin.constant.API;
import com.vlin.constant.TuyaAPIConstant;

@Configuration
@ConfigurationProperties(prefix="tuya")
public class TuyaProperties {

	private String clientId;
	
	private String secret;
	
	private String host;
	
	private String signMethod;
	
	private API api = API.TUYA;
	
	private ParamsConfig paramsConfig = new SimpleParamsConfig();
	
	public API getApi() {
		return api;
	}

	public void setApi(API api) {
		this.api = api;
	}

	public String getClientId() {
		return clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getSignMethod() {
		return signMethod;
	}

	public void setSignMethod(String signMethod) {
		this.signMethod = signMethod;
	}
	
	public ParamsConfig getParamsConfig() {
		paramsConfig.put(TuyaAPIConstant.CLIENT_ID_NAME, clientId);
		paramsConfig.put(TuyaAPIConstant.SECRET_NAME, secret);
		paramsConfig.put(TuyaAPIConstant.SIGN_METHOD_NAME, signMethod);
		return this.paramsConfig;
	}
	
}
